﻿@{
    ViewBag.Title = "CategoryEdit";
}
@using Course;
@using Course.Models;
<html>
<head>
    <title>后台</title>
    <link media="all" type="text/css" href="@Url.Content("../Content/Styles/BackHomePage.css")" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-treeview.js")" type="text/javascript"></script>
</head>
<body>
    <div id="body-wrapper">
        @RenderPage("../Shared/BackLeft.cshtml")
        <form action="CategoryEdit" method="post">
        <div id="main-content">
            <!-- Main Content Section with everything -->
            <noscript>
                <!-- Show a notification if the user has disabled javascript -->
                <div class="notification error png_bg">
                    <div>
                        Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/"
                            title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852"
                                title="Enable Javascript in your browser">enable</a> Javascript to navigate
                        the interface properly. Download From <a href="http://www.exet.tk">exet.tk</a></div>
                </div>
            </noscript>
            <div class="content-box">
                <!-- Start Content Box -->
                <div class="content-box-header">
                    <h3>
                        分类</h3>
                    @*  <ul class="content-box-tabs">
                        <li><a href="#tab1" class="default-tab">分类</a></li>
                        <!-- href must be unique and match the id of target div -->
                        <li><a href="#tab2">Forms</a></li>
                    </ul>*@
                    <div class="clear">
                    </div>
                </div>
                <!-- End .content-box-header -->
                <div class="content-box-content">
                    <div class="tab-content default-tab" id="tab1">
                        <!-- This is the target div. id must match the href of this div's tab -->
                        <div class="notification attention png_bg">
                            <a href="#" class="close">
                                <img src="@Url.Content("~/Content/Images/icons/cross_grey_small.png")" title="Close this notification" alt="close" /></a>
                            <div>
                                修改内容时注意格式
                            </div>
                        </div>
                        @{Category category = ViewData["one"] as Category;
                          IQueryable<Category> allCate = ViewData["allCate"] as IQueryable<Category>;
                        }
                        @Html.Label("分类名称")
                        <input type="text" name="CategoryName" value="@category.CName"/>
                        @{
                            List<SelectListItem> items = new List<SelectListItem>();

                            foreach (var cate in allCate)
                            {
                                SelectListItem item = new SelectListItem();
                                item.Value = cate.CategoryID.ToString();
                                item.Text = cate.CName;

                                items.Add(item);
                            }
                        }
                        @Html.DropDownList("ddlCate", items)
                        @Html.Label("无父类")
                        @*@Html.CheckBox("checkParent", true, new {value="true" })*@
                        <input type="checkbox" name="checkParent" value="1" />
                        @Html.Label("种类")
                            @{
                                List<SelectListItem> type = new List<SelectListItem>();

                                SelectListItem articleType = new SelectListItem();
                                articleType.Value = "true";
                                articleType.Text = "文章分类";

                                SelectListItem downloadType = new SelectListItem();
                                downloadType.Text = "下载分类";
                                downloadType.Value = "false";

                                type.Add(articleType);
                                type.Add(downloadType);
                                }
                                @Html.DropDownList("ddlType",type)
                        @Html.Label("排列")
                        <input type="text" name="OrderNum" value="@category.OrderNum" />
                        <input type="hidden" name="ID" value="@category.CategoryID" />
                        <input type="submit" value="确认修改" />
                    </div>
                    <!-- End #tab1 -->
                </div>
                <!-- End .content-box-content -->
            </div>
        </div>
        </form>
    </div>
</body>
</html>
